import request from '@/utils/request'

const baseApiUrl = '/sys/oss'

/**
 * get  --> params:
 * post --> data:
 */
export default {

  /**
	 * 服务端签名直传
	 */
  policy() {
    return request({
      url: `${baseApiUrl}/policy`,
      method: 'get'
    })
  },
  /**
	 * 分页+条件查询
	 * @param {json} params 请求参数(当前页+每页显示记录数+搜索条件)
	 * @returns
	 */
  getDataList(params) {
    return request({
      url: `${baseApiUrl}/list`,
      method: 'get',
      params: params
    })
  },
  /**
	 * 上传
	 * @param {file} file
	 * @returns
	 */
  savePolicyImgs(fileUrls) {
    return request({
      url: `${baseApiUrl}/savePolicyImgs`,
      method: 'post',
      data: fileUrls
    })
  },
  /**
	 * 删除
	 * @param {array} ids
	 * @returns
	 */
  deleteByIds(ids) {
    return request({
      url: `${baseApiUrl}/delete`,
      method: 'post',
      data: ids
    })
  }
}
